package asteroids.model.programs.expressions;

import asteroids.model.programs.statements.Statement;
import asteroids.model.programs.types.Type;
import be.kuleuven.cs.som.annotate.*;


public abstract class Expression {
	
	protected Expression(int line, int column){
		this.line = line;
		this.column = column;	
	}
	/**
	 * Returns the line where this Expression is.
	 * 
	 * @return this.line
	 */
	@Basic @Immutable
	public int getLine(){
		return line;
	}
	private int line;
	
	/**
	 * Returns the column where this Expression is.
	 * 
	 * @return this.column
	 */
	@Basic @Immutable
	public int getColumn(){
		return column;
	}
	private int column;
	
	@Basic@Immutable
	public Statement getStatement(){
		return statement;
	}
	
	public void setStatement(Statement newStatement){
		this.statement = newStatement;
	}
	private Statement statement;
	
	public abstract BasicExpression getResult();
	
	public abstract String toString();
	
	public abstract Type getType();
	
	public abstract String typeCheckExpression(String errorMessage);

}
